table_CCREM_Sub <- list()


table_CCREM_Sub[[1]] <- htmlreg(list(model_CCREM_Subcountry$fitCountry[[1]],model_CCREM_Subcountry$fitCountry[[2]],model_CCREM_Subcountry$fitCountry[[3]],model_CCREM_Subcountry$fitCountry[[4]],model_CCREM_Subcountry$fitCountry[[5]],model_CCREM_Subcountry$fitCountry[[6]],model_CCREM_Subcountry$fitCountry[[7]],model_CCREM_Subcountry$fitCountry[[8]],model_CCREM_Subcountry$fitCountry[[9]],model_CCREM_Subcountry$fitCountry[[10]],model_CCREM_Subcountry$fitCountry[[11]],model_CCREM_Subcountry$fitCountry[[12]],model_CCREM_Subcountry$fitCountry[[13]],model_CCREM_Subcountry$fitCountry[[14]],model_CCREM_Subcountry$fitCountry[[15]],model_CCREM_Subcountry$fitCountry[[16]]),
                                custom.model.names = c(as.character(model_CCREM_Fullcountry$country[c(1:16)])), custom.coef.map = list("age_grp_centered" = "Age (centered)", "I(age_grp_centered^2)" = "Age (centered)^2", "I(age_grp_centered^3)" = "Age (centered)^3", "born_adult_centered" = "Year turned 18", "I(born_adult_centered^2)" = "Year turned 18 ^2", "I(born_adult_centered^3)" = "Year turned 18 ^3", "sex" = "Gender", "(Intercept)" = "Intercept"), caption = "")

table_CCREM_Sub[[2]] <- htmlreg(list(model_CCREM_Subcountry$fitCountry[[17]],model_CCREM_Subcountry$fitCountry[[18]],model_CCREM_Subcountry$fitCountry[[19]],model_CCREM_Subcountry$fitCountry[[20]],model_CCREM_Subcountry$fitCountry[[21]],model_CCREM_Subcountry$fitCountry[[22]],model_CCREM_Subcountry$fitCountry[[23]],model_CCREM_Subcountry$fitCountry[[24]],model_CCREM_Subcountry$fitCountry[[25]],model_CCREM_Subcountry$fitCountry[[26]],model_CCREM_Subcountry$fitCountry[[27]],model_CCREM_Subcountry$fitCountry[[28]],model_CCREM_Subcountry$fitCountry[[29]],model_CCREM_Subcountry$fitCountry[[30]],model_CCREM_Subcountry$fitCountry[[31]]),
                                custom.model.names = c(as.character(model_CCREM_Fullcountry$country[c(17:31)])), custom.coef.map = list("age_grp_centered" = "Age (centered)", "I(age_grp_centered^2)" = "Age (centered)^2", "I(age_grp_centered^3)" = "Age (centered)^3", "born_adult_centered" = "Year turned 18", "I(born_adult_centered^2)" = "Year turned 18 ^2", "I(born_adult_centered^3)" = "Year turned 18 ^3", "sex" = "Gender", "(Intercept)" = "Intercept"), caption = "")

table_CCREM_Sub[[3]] <- htmlreg(list(model_CCREM_Subcountry$fitCountry[[32]],model_CCREM_Subcountry$fitCountry[[33]],model_CCREM_Subcountry$fitCountry[[34]],model_CCREM_Subcountry$fitCountry[[35]],model_CCREM_Subcountry$fitCountry[[36]],model_CCREM_Subcountry$fitCountry[[37]],model_CCREM_Subcountry$fitCountry[[38]],model_CCREM_Subcountry$fitCountry[[39]],model_CCREM_Subcountry$fitCountry[[40]],model_CCREM_Subcountry$fitCountry[[41]],model_CCREM_Subcountry$fitCountry[[42]],model_CCREM_Subcountry$fitCountry[[43]],model_CCREM_Subcountry$fitCountry[[44]],model_CCREM_Subcountry$fitCountry[[45]],model_CCREM_Subcountry$fitCountry[[46]]),
                                custom.model.names = c(as.character(model_CCREM_Fullcountry$country[c(32:46)])), custom.coef.map = list("age_grp_centered" = "Age (centered)", "I(age_grp_centered^2)" = "Age (centered)^2", "I(age_grp_centered^3)" = "Age (centered)^3", "born_adult_centered" = "Year turned 18", "I(born_adult_centered^2)" = "Year turned 18 ^2", "I(born_adult_centered^3)" = "Year turned 18 ^3", "sex" = "Gender", "(Intercept)" = "Intercept"), caption = "")


table_CCREM_Sub[[4]] <- htmlreg(list(model_CCREM_Subcountry$fitCountry[[47]],model_CCREM_Subcountry$fitCountry[[48]],model_CCREM_Subcountry$fitCountry[[49]],model_CCREM_Subcountry$fitCountry[[50]],model_CCREM_Subcountry$fitCountry[[51]],model_CCREM_Subcountry$fitCountry[[52]],model_CCREM_Subcountry$fitCountry[[53]],model_CCREM_Subcountry$fitCountry[[54]],model_CCREM_Subcountry$fitCountry[[55]],model_CCREM_Subcountry$fitCountry[[56]],model_CCREM_Subcountry$fitCountry[[57]],model_CCREM_Subcountry$fitCountry[[58]],model_CCREM_Subcountry$fitCountry[[59]],model_CCREM_Subcountry$fitCountry[[60]],model_CCREM_Subcountry$fitCountry[[61]]),
                                custom.model.names = c(as.character(model_CCREM_Fullcountry$country[c(47:61)])), custom.coef.map = list("age_grp_centered" = "Age (centered)", "I(age_grp_centered^2)" = "Age (centered)^2", "I(age_grp_centered^3)" = "Age (centered)^3", "born_adult_centered" = "Year turned 18", "I(born_adult_centered^2)" = "Year turned 18 ^2", "I(born_adult_centered^3)" = "Year turned 18 ^3", "sex" = "Gender", "(Intercept)" = "Intercept"), caption = "")


save(table_CCREM_Sub, file = paste0(wdShinyData,"html_list_CCREM_sub.Rdata"))
